{
  "properties" : { },
  "id" : "62e8962b3b744b2cbf90ac384e1734c1",
  "script" : null,
  "groupId" : "e7c57e1086a64d09a8c9d615ca57f6fd",
  "name" : "恢复",
  "createTime" : 1727071193481,
  "updateTime" : 1726714131281,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "rollback",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "{\n    \"id\":\"1801438872488411138\"\n}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"success\",\n    \"data\": \"未选择文件\"\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================


sql = """ 
    select * from ndmp_net_device_cfg_file where id = #{body.id}
 """
//备份的文件
cfgSaveAs = db.selectOne(sql)

if(cfgSaveAs == null){
    return "未选择文件"
}
cfgSaveAs.id = cfgSaveAs.flag
cfgSaveAs.flag = "0"
db.table("ndmp_net_device_cfg_file").primary("id").update(cfgSaveAs)
db.table('ndmp_net_device_cfg_file').where().eq('id',cfgSaveAs.id).delete()
if( true ) {
    return "还原成功"
}
return "还原失败"